<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>确认订单</title>
    <link rel="stylesheet" type="text/css" href="../../../css/index.css" />
    <style>

       	.address-list{width: 100%;}
		.address-list .address-one{width: 100%;background: #ffffff;padding: 10px 15px;box-sizing: border-box;margin-bottom: 10px;}
		.address-list .address-one .top-box{align-items: center;font-size: 14px;color: #333333;padding-top: 10px;box-sizing: border-box;line-height: 16px;}
		.address-list .address-one .top-box .phone{padding-left:10px;box-sizing: border-box;}
    	.address-list .address-one .top-box .moren{padding:0 4px;font-size: 10px;color:#FF9502;height: 14px;line-height: 15px;margin-left: 10px;}
        .address-list .address-one .top-box .moren::before{border: 1px solid #FF9502;border-radius: 4px;}
    	.address-list .address-one .content{font-size: 14px;color:#999999;word-break: break-all;padding: 6px 0 10px 0;box-sizing: border-box;line-height: 22px}

    	/*底部的固定按钮*/
		.shouhuo-btn{position: fixed;height: 45px;background:#FF9502;border-radius:4px;
		text-align: center;line-height: 45px;font-size: 18px;color: #FFFFFF;bottom: 40px;left: 30px;right: 30px;z-index: 999;}

    </style>
</head>

<body>
    <div id="vue">

    	<div class="address-list" style="display:none;" :style="{ display:(Pdata ? '':'none')}">

            <!--地址列表-->
    		<div class="address-one" v-for="(item,k) in Pdata.listData" :data-id="item.id" tapdome :onclick="'selectClick('+ k +')'">
    			<div class="top-box flex">
    				<div class="name" v-text="item.uname"></div>
    				<div class="phone" v-text="item.phone"></div>
    				<div class="moren border-all" v-if="item.default == 1">默认</div>
    			</div>
    			<div class="content" v-text="item.qustr + item.address"></div>
    		</div>

    	</div>

        <!--占位图-->
        <div class="nodata" style="display:none;" :style="{ display:(noData ? '':'none')}">
            <img src="../../../image/no_page/no_dizhi.png" />
            <p>暂无地址</p>
        </div>
        <!-- 底部 -->
        <div class="bottom-box" :style="{ display:(loadingMsg ? '':'none')}">
            <div class="msgbox" v-html="loadingMsg" style="color:#999;"></div>
        </div>


    	<!--底部的立即分享按钮-->
        <div class="warp-btn" id="app-footer" tapdome onclick="addAddress()">
            <div class="btn">新建地址</div>
        </div>

    </div>

<script type="text/javascript" src="../../../script/base.min.js" id="loadjs" data-load=""></script>
<script type="text/javascript">
    define(function (require, exports, module) {
        lanYun.setFooter('app-footer');

        getData = function(loading) {
            lanYun.getVueData({url:'address/index',get:{page:lanYun.page},cache:true,loading:loading}, function(ret) {
                //console.log(JSON.stringify(ret));
            });
        };
        lanYun.newVue('#vue', function() {
            getData();
        });

        //滚动加载..
    	new auiScroll({distance:200, listen:true},function(ret) {
    		if($(window).scrollTop() < 2) ret.isToBottom = false;
    		if(!ret.isToBottom) return;
    		getData(0);
    	});

        //============================

        onShow = function () {
            var reshpage = lanYun.getStorage('reshpage');
            if(reshpage){
                lanYun.rmStorage('reshpage');
                lanYun.ajaxPageSta = 0; lanYun.page = 1;
                getData(2);
            }
        }

        //新增地址
        addAddress = function(tis){
            lanYun.openWin('user/address/add.html', {
                title : '新建地址',
                frameParam : {type:'add'},
            });
        };

        //选择地址
        selectClick = function(index){
            lanYun.setStorage('address', lanYun.vue.Pdata.listData[index]);
            lanYun.setStorage('update',1);
            api.closeWin();
        }

    });
</script>
</body>
</html>
